forum

home / developersection / forums / access private method another class using constructor in java

Access private method another class using constructor in java

Anonymous User 2155 04-Feb-2015

So, i created a method in a class called Lotion and I named it read() this method takes the user's input. I was told by my instructor that the method read() had to be private. However, he said that his demo/tester class should be able to access the method read(). He gave us a hint saying we had to use a constructor. But unfortunately, I still don't understand how it's supposed to work. Can Someone please explain.

Thanks in advance.


Updated on 04-Jul-2023

I am a content writter !

Can you answer this question?

Answer

2 Answers

Liked By